package com.jsoft.test;

import org.junit.Test;

import java.text.ParseException;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author snkstart
 * @create 2023-02-22 13:06
 */
public class testNumber {


    /**
     * 测试no
     */
    @Test
    public void testNo() {
        StringBuilder no = new StringBuilder();
        no.append("N");

        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
        Date date = new Date();
        String now = simpleDateFormat.format(date);
        no.append(now);

        no.append("000001");
        System.out.println(no);

    }

    @Test
    public void testDate(){
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        String dateString = "2011-1-1";
        try {
            Date date2 = simpleDateFormat.parse(dateString);
            System.out.println(date2);
        } catch (ParseException e) {
            e.printStackTrace();
        }


    }
}
